/**
 *  @auth: sce
 *  @date: 17-12-29
 *  @desc:
 **/

import {connect} from 'react-redux'

import {action} from './../reducer/calculator'
import Calculator from './../view/Calculator'

const {equalAction, changeAction} = action;

function mapStateToProps({calculatorReducer}) {
    return {...calculatorReducer};
}

function mapDispatchToProps(dispatch) {
    return {
        onEqualExpress : () => dispatch(equalAction()),
        onChangeExpress: (express) => dispatch(changeAction(express))
    }
}

const CalculatorContainer = connect(
    mapStateToProps,
    mapDispatchToProps
)(Calculator);

export default CalculatorContainer;